using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using DomainModel;
using ErrorLog;



namespace BL
{
    class BLMsgPool
    {

        /*ErrorCapsule: stroing error messages
         * Parm: CreatorId : showing person who created error message. 
         *        CreatorId = 1: Bob
         *        CreatorId = 2: jon
         *        CreatorId = 3: janet
         *        CreatorId = 4: sally 
         */

        public static void ErrorCapsule(int CreatorId , int CaseNum, ref List<string> errors)
        {
            String errorMsg = "";
            if (CaseNum == 1 && CreatorId == 1)
            {
                errorMsg = "Customer can not be null";
            }
            else if (CaseNum == 2 && CreatorId == 1)
            {
                errorMsg = "First name can not be empty";
            }
            else if (CaseNum == 3 && CreatorId == 1)
            {
                errorMsg = "Last name can not be empty";
            }
            else if (CaseNum == 4 && CreatorId == 1)
            {
                errorMsg = "Address can not be empty";
            }
            else if (CaseNum == 5 && CreatorId == 1)
            {
                errorMsg = "State can not be empty";
            }
            else if (CaseNum == 6 && CreatorId == 1)
            {
                errorMsg = "Zip code can not be more than 5 digits";
            }
            else if(CaseNum ==  7 && CreatorId == 1)
            {
                errorMsg = "WebMaster input can not be other expressions";
            }
            else if (CaseNum == 8 && CreatorId == 1)
            {
                errorMsg = "Block user input can not be other expressions ";
            }
            else if (CaseNum == 9 && CreatorId == 1) 
            {
                errorMsg = "Permission can not be this expression";
            }
            else if(CaseNum == 10 && CreatorId == 1)
            {
                errorMsg = "User ID can't be negative";
            }
            else if(CaseNum == 11 && CreatorId == 1)
            {
                errorMsg = "It can't be right expression ";
            }
            else if (CaseNum == 12 && CreatorId == 1)
            {
                errorMsg = "It can't be right email expression ";
            }
            else if(CaseNum == 13 && CreatorId == 1)
            {
                errorMsg = "Iteam state can not be negative";
            }
            else if(CaseNum == 14 && CreatorId ==1)
            {
                errorMsg = "Login Email can't be null";
            }
            else if(CaseNum == 15 && CreatorId == 1)
            {
                errorMsg = "Frist name can not be null";
            }
            else if (CaseNum == 1 && CreatorId == 2)
            {
                errorMsg = "ID must be positive.";
            }
            else if (CaseNum == 2 && CreatorId == 2)
            {
                errorMsg = "Address can not be empty.";
            }
            else if (CaseNum == 3 && CreatorId == 2)
            {
                errorMsg = "State can not be empty.";
            }
            else if (CaseNum == 4 && CreatorId == 2)
            {
                errorMsg = "Zip code must have 5 digits.";
            }
            else if (CaseNum == 5 && CreatorId == 2)
            {
                errorMsg = "City can not be empty.";
            }
            else if (CaseNum == 6 && CreatorId == 2)
            {
                errorMsg = "Customer can not be null.";
            }
            else if (CaseNum == 7 && CreatorId == 2)
            {
                errorMsg = "First name can not be empty.";
            }
            else if (CaseNum == 8 && CreatorId == 2)
            {
                errorMsg = "Last name can not be empty.";
            }
            else if(CaseNum == 11 && CreatorId == 1)
            {
                errorMsg = "It can't be right expression ";
            }
            else if (CaseNum == 1 && CreatorId == 3)
            {
                errorMsg = "Order cannot be null.";
            }
            else if (CaseNum == 2 && CreatorId == 3)
            {
                errorMsg = "Must use an existing customer.";
            }
            else if (CaseNum == 3 && CreatorId == 3)
            {
                errorMsg = "id input is not valid.";
            }
            else if (CaseNum == 4 && CreatorId == 3)
            {
                errorMsg = "item cannot be null.";
            }
            else if (CaseNum == 5 && CreatorId == 3)
            {
                errorMsg = "product id input invalid.";
            }
            else if (CaseNum == 6 && CreatorId == 3)
            {
                errorMsg = "This email already exists.";
            }
            else if (CaseNum == 7 && CreatorId == 3)
            {
                errorMsg = "This product is already in the order!";
            }
            else if (CaseNum == 8 && CreatorId == 3)
            {
                errorMsg = "Order id does not exist!";
            }
            else if (CaseNum == 9 && CreatorId == 3)
            {
                errorMsg = "Product id does not exists!";
            }
            else if (CaseNum == 1 && CreatorId == 4)
            {
                errorMsg = "Display type does not exist.";
            }
            else if (CaseNum == 2 && CreatorId == 4)
            {
                errorMsg = "Make type does not exist.";
            }
            else if (CaseNum == 3 && CreatorId == 4)
            {
                errorMsg = "Size type does not exist.";
            }
            else if (CaseNum == 4 && CreatorId == 4)
            {
                errorMsg = "Resolution type does not exist.";
            }
            else if (CaseNum == 5 && CreatorId == 4)
            {
                errorMsg = "Refresh type does not exists.";
            }
            else if (CaseNum == 6 && CreatorId == 4)
            {
                errorMsg = "Shipping option is not valid.";
            }
            else if (CaseNum == 7 && CreatorId == 4)
            {
                errorMsg = "Order number cannot be null.";
            }
            else if (CaseNum == 8 && CreatorId == 4)
            {
                errorMsg = "Order number does not exist.";
            }


            errors.Add(errorMsg);

            AsynchLog.LogNow(errorMsg);

            return;

        }

    }
}
